package cn.tedu.shoot;
import javax.swing.*;
import java.time.Year;
import java.util.Random;
/** 大敌机:是飞行物 */
public class BigAirplane extends FlyingObject implements EnemyScore{
    private int speed; //移动速度
    /** 构造方法 */
    public BigAirplane(){
        super(66,89);
        speed = 2;
    }

    /** 重写step()移动 */
    public void step(){
        y+=speed;
    }

    int index = 1;
    public ImageIcon getImage(){
        if (isLive()){
            return Images.bigairplanes[0];
        }else if (isDead()){
            ImageIcon img = Images.bigairplanes[index++];
            if (index == Images.bigairplanes.length){
                state = REMOVE;
            }
            return img;
        }
        return null;
    }

    @Override
    public int getScore() {
        return 3;
    }
}
